home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / graphics / GELS.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  10KB  |  307 lines

  1. #ifndef GRAPHICS_GELS_H
  2. #define GRAPHICS_GELS_H 1
  3. /*
  4. ** gels.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/01/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for gels.h
  17. */
  18. #ifndef AnimCompPtr
  19. #define AnimCompPtr ADDRESS
  20. #endif
  21. #ifndef AnimObPtr
  22. #define AnimObPtr ADDRESS
  23. #endif
  24. #ifndef BobPtr
  25. #define BobPtr ADDRESS
  26. #endif
  27. #ifndef DBufPacketPtr
  28. #define DBufPacketPtr ADDRESS
  29. #endif
  30. #ifndef VSpritePtr
  31. #define VSpritePtr ADDRESS
  32. #endif
  33. #ifndef collTablePtr
  34. #define collTablePtr ADDRESS
  35. #endif
  36. /*
  37. ** End of StructPointer defines for gels.h
  38. */
  39.        
  40. #ifndef EXEC_TYPES_H
  41. #include <exec/types.h>
  42. #endif
  43.  
  44.  
  45. /* VSprite flags */
  46. /* user-set VSprite flags: */
  47. #define SUSERFLAGS  &H00FF    /* mask of all user-settable VSprite-flags */
  48. #define VSPRITE     &H0001    /* set if VSprite,  clear if Bob */
  49. #define SAVEBACK    &H0002    /* set if background is to be saved/restored */
  50. #define OVERLAY     &H0004    /* set to mask image of Bob onto background */
  51. #define MUSTDRAW    &H0008    /* set if VSprite absolutely must be drawn */
  52. /* system-set VSprite flags: */
  53. #define BACKSAVED   &H0100    /* this Bob's background has been saved */
  54. #define BOBUPDATE   &H0200    /* temporary flag,  useless to outside world */
  55. #define GELGONE     &H0400    /* set if gel is completely clipped (offscreen) */
  56. #define VSOVERFLOW  &H0800    /* VSprite overflow (if MUSTDRAW set we draw!) */
  57.  
  58. /* Bob flags */
  59. /* these are the user flag bits */
  60. #define BUSERFLAGS  &H00FF    /* mask of all user-settable Bob-flags */
  61. #define SAVEBOB     &H0001    /* set to not erase Bob */
  62. #define BOBISCOMP   &H0002    /* set to identify Bob as AnimComp */
  63. /* these are the system flag bits */
  64. #define BWAITING    &H0100    /* set while Bob is waiting on 'after' */
  65. #define BDRAWN      &H0200    /* set when Bob is drawn this DrawG pass*/
  66. #define BOBSAWAY    &H0400    /* set to initiate removal of Bob */
  67. #define BOBNIX      &H0800    /* set when Bob is completely removed */
  68. #define SAVEPRESERVE &H1000   /* for back-restore during double-buffer*/
  69. #define OUTSTEP     &H2000    /* for double-clearing if double-buffer */
  70.  
  71. /* defines for the animation procedures */
  72. #define ANFRACSIZE  6
  73. #define ANIMHALF    &H0020
  74. #define RINGTRIGGER &H0001
  75.  
  76.  
  77. /* UserStuff definitions
  78.  *  the user can define these to be a single variable or a sub-structure
  79.  *  if undefined by the user,  the system turns these into innocuous variables
  80.  *  see the manual for a thorough definition of the UserStuff definitions
  81.  *
  82.  */
  83. #ifndef VUserStuff        /* VSprite user stuff */
  84. #define VUserStuff SHORTINT
  85. #endif
  86.  
  87. #ifndef BUserStuff        /* Bob user stuff */
  88. #define BUserStuff SHORTINT
  89. #endif
  90.  
  91. #ifndef AUserStuff        /* AnimOb user stuff */
  92. #define AUserStuff SHORTINT
  93. #endif
  94.  
  95.  
  96.  
  97.  
  98. /*********************** GEL STRUCTURES ***********************************/
  99.  
  100. STRUCT VSprite
  101.  
  102. /* --------------------- SYSTEM VARIABLES ------------------------------- */
  103. /* GEL linked list forward/backward pointers sorted by y, x value */
  104.     VSpritePtr  NextVSprite 
  105.     VSpritePtr  PrevVSprite 
  106.  
  107. /* GEL draw list constructed in the order the Bobs are actually drawn,  then
  108.  *  list is copied to clear list
  109.  *  must be here in VSprite for system boundary detection
  110.  */
  111.     VSpritePtr  DrawPath      /* pointer of overlay drawing */
  112.     VSpritePtr  ClearPath     /* pointer for overlay clearing */
  113.  
  114. /* the VSprite positions are defined in (y, x) order to make sorting
  115.  *  sorting easier,  since (y, x) as a LONGINT integer
  116.  */
  117.     SHORTINT OldY 
  118.     SHORTINT   OldX           /* previous position */
  119.  
  120. /* --------------------- COMMON VARIABLES --------------------------------- */
  121.     SHORTINT Flags        /* VSprite flags */
  122.  
  123.  
  124. /* --------------------- USER VARIABLES ----------------------------------- */
  125. /* the VSprite positions are defined in (y, x) order to make sorting
  126.  *  sorting easier,  since (y, x) as a LONGINT integer
  127.  */
  128.     SHORTINT Y 
  129.     SHORTINT   X             /* screen position */
  130.  
  131.     SHORTINT Height 
  132.     SHORTINT _Width        /* number of words per row of image data */
  133.     SHORTINT Depth        /* number of planes of data */
  134.  
  135.     SHORTINT MeMask           /* which types can collide with this VSprite*/
  136.     SHORTINT HitMask          /* which types this VSprite can collide with*/
  137.  
  138.     ADDRESS   ImageData           /* pointer to VSprite image */
  139.  
  140. /* borderLine is the one-dimensional logical OR of all
  141.  *  the VSprite bits,  used for fast collision detection of edge
  142.  */
  143.     ADDRESS   BorderLine          /* logical OR of all VSprite bits */
  144.     ADDRESS   CollMask        /* similar to above except this is a matrix */
  145.  
  146. /* pointer to this VSprite's color definitions (not used by Bobs) */
  147.     ADDRESS   SprColors 
  148.  
  149.     BobPtr  VSBob         /* points home if this VSprite is part of
  150.                    a Bob */
  151.  
  152. /* planePick flag:  set bit selects a plane from image,  clear bit selects
  153.  *  use of shadow mask for that plane
  154.  * OnOff flag: if using shadow mask to fill plane,  this bit (corresponding
  155.  *  to bit in planePick) describes whether to fill with 0's or 1's
  156.  * There are two uses for these flags:
  157.  *  - if this is the VSprite of a Bob,  these flags describe how the Bob
  158.  *    is to be drawn into memory
  159.  *  - if this is a simple VSprite and the user intends on setting the
  160.  *    MUSTDRAW flag of the VSprite,  these flags must be set too to describe
  161.  *    which color registers the user wants for the image
  162.  */
  163.     BYTE PlanePick 
  164.     BYTE PlaneOnOff 
  165.  
  166.     VUserStuff VUserExt       /* user definable:  see note above */
  167. END STRUCT 
  168.  
  169. STRUCT Bob
  170. /* blitter-objects */
  171.  
  172. /* --------------------- SYSTEM VARIABLES --------------------------------- */
  173.  
  174. /* --------------------- COMMON VARIABLES --------------------------------- */
  175.     SHORTINT Flags  /* general purpose flags (see definitions below) */
  176.  
  177. /* --------------------- USER VARIABLES ----------------------------------- */
  178.     ADDRESS   SaveBuffer    /* pointer to the buffer for background save */
  179.  
  180. /* used by Bobs for "cookie-cutting" and multi-plane masking */
  181.     ADDRESS   ImageShadow 
  182.  
  183. /* pointer to BOBs for sequenced drawing of Bobs
  184.  *  for correct overlaying of multiple component animations
  185.  */
  186.     BobPtr  Before  /* draw this Bob before Bob pointed to by before */
  187.     BobPtr  After   /* draw this Bob after Bob pointed to by after */
  188.  
  189.     VSpritePtr  BobVSprite    /* this Bob's VSprite definition */
  190.  
  191.     AnimCompPtr  BobComp       /* pointer to this Bob's AnimComp def */
  192.  
  193.     DBufPacketPtr  DBuffer      /* pointer to this Bob's dBuf packet */
  194.  
  195.     BUserStuff BUserExt         /* Bob user extension */
  196. END STRUCT 
  197.  
  198. STRUCT AnimComp
  199.  
  200. /* --------------------- SYSTEM VARIABLES --------------------------------- */
  201.  
  202. /* --------------------- COMMON VARIABLES --------------------------------- */
  203.     SHORTINT Flags          /* AnimComp flags for system & user */
  204.  
  205. /* timer defines how LONGINT to keep this component active:
  206.  *  if set non-zero,  timer decrements to zero then switches to nextSeq
  207.  *  if set to zero,  AnimComp never switches
  208.  */
  209.     SHORTINT _Timer 
  210.  
  211. /* --------------------- USER VARIABLES ----------------------------------- */
  212. /* initial value for timer when the AnimComp is activated by the system */
  213.     SHORTINT TimeSet 
  214.  
  215. /* pointer to next and previous components of animation object */
  216.     AnimCompPtr  NextComp 
  217.     AnimCompPtr  PrevComp 
  218.  
  219. /* pointer to component component definition of next image in sequence */
  220.     AnimCompPtr  NextSeq 
  221.     AnimCompPtr  PrevSeq 
  222.  
  223.     ADDRESS   AnimCRoutine  /* address of special animation procedure */
  224.  
  225.     SHORTINT YTrans      /* initial y translation (if this is a component) */
  226.     SHORTINT XTrans      /* initial x translation (if this is a component) */
  227.  
  228.     AnimObPtr  HeadOb 
  229.  
  230.     BobPtr  AnimBob 
  231. END STRUCT 
  232.  
  233. STRUCT AnimOb
  234.  
  235. /* --------------------- SYSTEM VARIABLES --------------------------------- */
  236.     AnimObPtr  NextOb 
  237.     AnimObPtr  PrevOb 
  238.  
  239. /* number of calls to Animate this AnimOb has endured */
  240.     LONGINT Clock 
  241.  
  242.     SHORTINT AnOldY 
  243.     SHORTINT   AnOldX         /* old y, x coordinates */
  244.  
  245. /* --------------------- COMMON VARIABLES --------------------------------- */
  246.     SHORTINT AnY 
  247.     SHORTINT   AnX           /* y, x coordinates of the AnimOb */
  248.  
  249. /* --------------------- USER VARIABLES ----------------------------------- */
  250.     SHORTINT YVel 
  251.     SHORTINT   XVel             /* velocities of this object */
  252.     SHORTINT YAccel 
  253.     SHORTINT   XAccel         /* accelerations of this object */
  254.  
  255.     SHORTINT RingYTrans 
  256.     SHORTINT   RingXTrans     /* ring translation values */
  257.  
  258.     ADDRESS   AnimORoutine      /* address of special animation
  259.                        procedure */
  260.  
  261.     AnimCompPtr  HeadComp      /* pointer to first component */
  262.  
  263.     AUserStuff AUserExt         /* AnimOb user extension */
  264. END STRUCT 
  265.  
  266. /* dBufPacket defines the values needed to be saved across buffer to buffer
  267.  *  when in double-buffer mode
  268.  */
  269. STRUCT DBufPacket
  270.  
  271.     SHORTINT BufY 
  272.     SHORTINT   BufX             /* save the other buffers screen coordinates */
  273.     VSpritePtr  BufPath       /* carry the draw path over the gap */
  274.  
  275. /* these pointers must be filled in by the user */
  276. /* pointer to other buffer's background save buffer */
  277.     ADDRESS   BufBuffer 
  278. END STRUCT 
  279.  
  280.  
  281.  
  282. /* ************************************************************************ */
  283.  
  284. /* these are GEL functions that are currently simple enough to exist as a
  285.  *  definition.  It should not be assumed that this will always be the case
  286.  */
  287. /*
  288. #define InitAnimate(animKey) { *(animKey) = NULL }
  289. #define RemBob(b)  {(b)->Flags |= BOBSAWAY }
  290. */
  291.  
  292. /* ************************************************************************ */
  293.  
  294. #define B2NORM      0
  295. #define B2SWAP      1
  296. #define B2BOBBER    2
  297.  
  298. /* ************************************************************************ */
  299.  
  300. /* a structure to contain the 16 collision procedure addresses */
  301. STRUCT collTable
  302.  
  303. STRING collPtrs SIZE 64   /*  16*SIZEOF(ADDRESS)  */
  304. END STRUCT 
  305.  
  306. #endif  /* GRAPHICS_GELS_H */
  307.